package com.healthbox.appointmentservice.controller;

import com.healthbox.appointmentservice.common.Result;
import com.healthbox.appointmentservice.config.AppointmentConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author pengpeng
 * @date 2022/5/10
 */
@RestController
@RequestMapping("/appointments")
@Api( tags = "应用配置")
public class TestConfigController {
    @Autowired
    private AppointmentConfig config;

    @ApiOperation(value = "测试远程配置的方法", notes = "配置可以在nacos配置中修改查看返回值变化")
    @GetMapping
    public Result<String> testConfig() {
        return Result.ok(config.toString());
    }
}
